const http = require('http')
const router = require('./router')

const server = http.createServer((req, res) => {
    if (req.url === '/') {
        router.showIndex(req, res)
    } else if (req.url === '/student') {
        router.showStudent(req, res)
    } else {
        router.show404(req, res)
    }
})

server.listen(80, 'localhost', () => {
    console.log('server running on port 80')
})